package com.ttxs.uaa.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ttxs.common.core.valid.Create;
import com.ttxs.common.core.valid.Update;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author john.yi@qq.com
 * @since 2021-08-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class SysPlatform implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 平台ID
     */
    @TableId(value = "platform_id", type = IdType.ASSIGN_ID)
    private String platformId;
    /**
     * 平台密钥
     */
    private String platformSecret;

    /**
     * 平台英文名称
     */
    @Pattern(regexp = "^[a-z][a-z0-9_-]{2,19}$", groups = {Create.class, Update.class}, message = "平台名称由小写字母开头，数字、小写字母、划线组合，长度3-20")
    private String platformName;

    /**
     * 平台中文名称
     */
    private String platformNameZh;
    /**
     * 登录回调地址（网关+微服务名字+/loginCallback）
     */
    private String loginCallbackUrl;
    /**
     * 平台说明
     */
    private String description;

    /**
     * 平台状态（0正常 1停用）
     */
    private String status;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
}
